package cn.edu.xmu.orderpayment.payment.microservice.service;

import cn.edu.xmu.oomall.core.util.ReturnObject;
import cn.edu.xmu.privilegegateway.annotation.aop.LoginUser;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.time.LocalDateTime;

@FeignClient(value = "order")
public interface OrderService {
    @ApiOperation(value = "通过documentId查订单")
    @GetMapping("/orders")
    ReturnObject getOrderByExample(@RequestParam("loginUser") @LoginUser Long loginUser,
                                   @RequestParam("orderSn")String orderSn,
                                   @RequestParam("state") Integer state,
                                   @RequestParam("beginTime") LocalDateTime beginTime,
                                   @RequestParam("endTime")LocalDateTime endTime,
                                   @RequestParam("page") Integer page,
                                   @RequestParam("pageSize") Integer pageSize);

    @ApiOperation(value = "修改订单状态订单")
    @PutMapping("/internal/orders")
    ReturnObject updateOrderState(@RequestParam("id") Long id,@RequestParam("state") Integer state);
}
